﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace 学生成绩管理系统
{
    public partial class addstudent : Form
    {
        public addstudent()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string strSql;
            DataAccess data = new DataAccess();
            strSql="insert into Studentinfo(Sid,Sname,Sex,Birthday,Class,Tel,Address) values('"+ textBox1.Text  +"','"+textBox5.Text +"','"+comboBox1.Text +"','"+textBox6.Text +"','"+textBox6.Text +"','"+textBox3.Text +"','"+textBox7.Text +"','"+textBox4.Text +"')";
            data.dataCon();
            if (data.sqlExec(strSql))
            {
                MessageBox.Show("添加成功！！");

            }
            else { MessageBox.Show("添加失败！！"); }
        }
    }
}
